<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>登录平台</title>
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="layui/css/layui.css">
<link rel="stylesheet" href="css/login.css">
</head>

<body style="background-image: url(img/log_img/login-bg2.jpg);background-size:100%;background-repeat: no-repeat;">
	<div class="layui-carousel video_mask" id="login_carousel">

		<div class="login layui-anim layui-anim-up">
			<div class="layui-logo">
				<h1 style="color: white; font-size: 50px; font-family:"宋体";">小租租</h1>
			</div>
			
			<fieldset class="layui-elem-field layui-field-title">
				<legend class="text-white">登录平台</legend>
			</fieldset>
			<div class="layui-form" action="" method="post">
				<div class="layui-form-item">
					<input type="userName" id="userName" lay-verify="required"
						maxlength="20" placeholder="请输入账号" autocomplete="off"
						autofocus="autofocus" class="layui-input">
				</div>
				<div class="layui-form-item">
					<input type="password" id="password" lay-verify="required"
						maxlength="20" placeholder="请输入密码" autocomplete="off"
						class="layui-input">
				</div>


				<button
					class="login_btn layui-btn layui-btn-radius layui-btn-normal"
					lay-submit lay-filter="login">登录</button>
				<strong class="text-white">还没有账号？ <a href="/doRegisterUI"
					style="color: cornflowerblue;">立即注册&raquo;</a></strong>
			</div>
			<hr class="layui-bg-gray">
			<div class="layui-footer text-white">
				<!-- 底部固定区域 -->
				&copy; 广州天河北CGB2006班版权所有
			</div>
		</div>
	</div>

	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="layui/layui.all.js"></script>
	<script type="text/javascript" src="js/login.js"></script>
	<script type="text/javascript">
		$(function() {
			$(".login_btn").on("click", doLogin);
		});
		function doLogin() {

			var url = "user/doLogin";
			var params={
					 userName:$("#userName").val(),
					 password:$("#password").val(),
				  }
			
			$.post(url, params, function(result) {
				if (result.state==1) {
					//跳转到indexUI对应的页面
					location.href = "IndexUI";
				} else {
					 alert(result.message);
				}
			});
		}
	</script>
</body>

</html>